Optimal. Leaf size=186 \[ \frac {2 \left (2 a^2-b^2\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 \left (a^2-b^2\right ) d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {4 a \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 d \sqrt {a+b \cos (c+d x)}}-\frac {2 a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d \sqrt {a+b \cos (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 186, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {2869, 2831,
2742, 2740, 2734, 2732} \begin {gather*} -\frac {2 a^2 \sin (c+d x)}{b d \left (a^2-b^2\right ) \sqrt {a+b \cos (c+d x)}}+\frac {2 \left (2 a^2-b^2\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 d \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {4 a \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 d \sqrt {a+b \cos (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2831
Rule 2869
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^{3/2}} \, dx &=-\frac {2 a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d \sqrt {a+b \cos (c+d x)}}+\frac {2 \int \frac {\frac {a b}{2}+\frac {1}{2} \left (2 a^2-b^2\right ) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{b \left (a^2-b^2\right )}\\ &=-\frac {2 a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d \sqrt {a+b \cos (c+d x)}}-\frac {(2 a) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{b^2}+\frac {\left (2 a^2-b^2\right ) \int \sqrt {a+b \cos (c+d x)} \, dx}{b^2 \left (a^2-b^2\right )}\\ &=-\frac {2 a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d \sqrt {a+b \cos (c+d x)}}+\frac {\left (\left (2 a^2-b^2\right ) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{b^2 \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {\left (2 a \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{b^2 \sqrt {a+b \cos (c+d x)}}\\ &=\frac {2 \left (2 a^2-b^2\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 \left (a^2-b^2\right ) d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {4 a \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b^2 d \sqrt {a+b \cos (c+d x)}}-\frac {2 a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d \sqrt {a+b \cos (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.73, size = 159, normalized size = 0.85 \begin {gather*} \frac {2 \left (2 a^3+2 a^2 b-a b^2-b^3\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-2 a \left (2 \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )+a b \sin (c+d x)\right )}{(a-b) b^2 (a+b) d \sqrt {a+b \cos (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(529\) vs.
\(2(234)=468\).
time = 0.24, size = 530, normalized size = 2.85
method | result | size |
default | \(-\frac {2 \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2} b -2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{3}+2 b^{2} a \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{3}-2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2} b -\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a \,b^{2}+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-\frac {2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a -b}+\frac {a +b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) b^{3}\right )}{b^{2} \left (a -b \right ) \left (a +b \right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a +b}\, d}\) | \(530\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.16, size = 567, normalized size = 3.05 \begin {gather*} -\frac {6 \, \sqrt {b \cos \left (d x + c\right ) + a} a^{2} b^{2} \sin \left (d x + c\right ) + {\left (\sqrt {2} {\left (-4 i \, a^{3} b + 5 i \, a b^{3}\right )} \cos \left (d x + c\right ) + \sqrt {2} {\left (-4 i \, a^{4} + 5 i \, a^{2} b^{2}\right )}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + {\left (\sqrt {2} {\left (4 i \, a^{3} b - 5 i \, a b^{3}\right )} \cos \left (d x + c\right ) + \sqrt {2} {\left (4 i \, a^{4} - 5 i \, a^{2} b^{2}\right )}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) - 3 \, {\left (\sqrt {2} {\left (2 i \, a^{2} b^{2} - i \, b^{4}\right )} \cos \left (d x + c\right ) + \sqrt {2} {\left (2 i \, a^{3} b - i \, a b^{3}\right )}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 \, {\left (\sqrt {2} {\left (-2 i \, a^{2} b^{2} + i \, b^{4}\right )} \cos \left (d x + c\right ) + \sqrt {2} {\left (-2 i \, a^{3} b + i \, a b^{3}\right )}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right )}{3 \, {\left ({\left (a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{3} b^{3} - a b^{5}\right )} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{2}{\left (c + d x \right )}}{\left (a + b \cos {\left (c + d x \right )}\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2}{{\left (a+b\,\cos \left (c+d\,x\right )\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________